<script setup lang="ts">
import { useRouter } from 'vue-router'

const router = useRouter()

// 查看订单
const viewOrder = () => {
  router.push('/home/profile')
}

// 返回首页
const goHome = () => {
  router.push('/home/hotels')
}
</script>

<template>
  <div class="success-container">
    <div class="success-icon">
      <van-icon name="checked" size="64" color="#1989fa" />
    </div>
    <div class="success-title">预订成功</div>
    <div class="success-desc">您的订单已创建成功，将为您安排最舒适的客房体验</div>
    
    <div class="action-buttons">
      <van-button type="primary" round block @click="viewOrder">查看订单</van-button>
      <van-button plain round block class="home-button" @click="goHome">返回首页</van-button>
    </div>
  </div>
</template>

<style scoped>
.success-container {
  min-height: 100vh;
  background-color: #fff;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding-top: 80px;
  padding-bottom: 40px;
}

.success-icon {
  margin-bottom: 20px;
}

.success-title {
  font-size: 24px;
  font-weight: bold;
  margin-bottom: 10px;
}

.success-desc {
  font-size: 14px;
  color: #666;
  text-align: center;
  margin-bottom: 30px;
  padding: 0 20px;
}

.action-buttons {
  width: 80%;
  max-width: 300px;
}

.home-button {
  margin-top: 16px;
}
</style> 